
		<?php
		// no direct access
		defined( '_VALID_MOS' ) or die( 'Restricted access' );

		global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_sitename, $database, $mosConfig_caching, $mosConfig_cachepath, $mainframe, $mosConfig_dbprefix, $mosConfig_sef, $mosConfig_db, $mosConfig_lifetime, $mosConfig_debug, $mosConfig_host, $mosConfig_offline;

		$width 	= 400;	// width of 100%
		$tabs 	= new mosTabs(0);


		$tabs->startPane("sysinfo");
		$tabs->startTab("HISA","system-page");
		?>


		
<table border='0' cellspacing='2' cellpadding='2' id='jts-container' class="adminform">
  <tr>
    <th colspan="3">
      Mambo Health, Installation and Security Audit
    </th>
  </tr>
	<tr>
      <td width="170" valign="top" style="padding-left: 15px;" class="left-col">
		<?php
		// CONSTANTS

		if (file_exists( '../includes/version.php' )) {
			$latestMVer    = '4.6.2';
			$_VERSION 	   = new version();
			$thisMVer      = $_VERSION->RELEASE .'.'. $_VERSION->DEV_LEVEL;
			$thisMRel      = $_VERSION->RELEASE;
			$thisMDevLev   = $_VERSION->DEV_LEVEL;
			$thisMDevStat  = $_VERSION->DEV_STATUS;
			$version 	   = $_VERSION->PRODUCT .' '. $_VERSION->RELEASE .'.'. $_VERSION->DEV_LEVEL .' '. $_VERSION->DEV_STATUS.' [ '.$_VERSION->CODENAME .' ] '. $_VERSION->RELDATE .' '. $_VERSION->RELTIME .' '. $_VERSION->RELTZ;
			$isV46 = "1";
		}

		$sp			   = ini_get('session.save_path');
		$currentPHP    = '5.2.4';
		$isWin         = (substr(PHP_OS, 0, 3) == 'WIN');

		// MESSAGES
		/** Messages
		* $im_ = Informaitonal Message
		* $am_ = Advisory Message
		* $gm_ = Good Message
		* $wm_ = Warning Message
		* $em_ = Error Message
		**/

        $RG_EmulationON       = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>Mambo RG_EMULATION is <b>ON</b> - This may pose a potential threat to your site.";
        $am_RG_EmulationON    = "Mambo RG_EMULATION should be turned Off, this function potentially exposes your site to exploits. If you have any extensions that require RG_EMULATION to be On, they should be un-installed immediately. Refer Mambo Security FAQ's";
        $RG_EmulationOFF      = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>Mambo RG_EMULATION is <b>OFF</b> - This greatly increases the security of your site.";


	// Common v4.6
    	$gm_MUpToDate         = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>Your Mambo instance is up to date. <p>At the time of this MTS Release the latest version was ". $latestMVer ."</p>";
    	$wm_MOutOfDate        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>Your Mambo instance is not at the latest release. (". $latestMVer .")";
		$am_MConsiderUpgrade  = "You should consider upgrading to ". $latestMVer ." as soon as is feasible.";
		$im_MNotStable        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>You are running a <b>". $thisMDevStat ."</b> release version of Mambo.";
		$am_MStableUpgrade    = "You should consider upgrading to a <b>Stable</b> version of ". $latestMVer ." as soon as is feasible.";
		$em_MBelowEleven      = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>You are running a version of Mambo below 4.6. There are serious security implications you should consider.";
	    $wm_phpDownlevel      = "Your version of PHP is not at the latest release of ". $currentPHP ."";
        $am_phpBelowFive      = "Your version of PHP below V5, you may wish to consider moving to a higher revision for enhanced security measures.";
  	    $im_webserverVIP      = "The Web-Servers virtual Site IP Address ( ". $_SERVER['SERVER_ADDR'] .") will be your Web Site IP Address";
	    $im_webserverDocRoot  = "The Document Root is most likely going to be the base of your Mambo absolute_path variable, with any sub-directory appended to it that you have installed Mambo into.";
        $shellExecDisabled    = "<b><font color='red'>*</font> PHP shell_exec</b> function is disabled. This means we could only determine your site IP, not the servers IP if it is different. Many hosts disable this PHP function for added security.";
        $execDisabled         = "<b><font color='red'>*</font> PHP exec</b> function is disabled. This means we could only determine your site IP, not the servers IP if it is different. Many hosts disable this PHP function for added security.";
        $passthruDisabled     = "<b><font color='red'>*</font> PHP passthru</b> function is disabled. This means we could only determine your account name, not the web-servers. Many hosts disable this PHP function for added security.";
		$obtainServerAccount  = "Unable to Obtain Server Account (This is not an error, see messages)";
        $noSuExec             = "Your WebServer appears not to run under an SuExec environment. Which means your user account and the WebServer process account are different. This can lead to file ownership problems for files made by, or uploaded via, Mambo";
        $noSuExecWarn         = "Due to your WebServer not utilising an SuExec environment, you will need to set directories to \"777\" permissions to provide write access to the webserver. Elevated (777) permissions may lead to your site being compromised.";
        $noSuExecAdvice       = "Ask if your hosting environment can be upgraded to support SuExec or only elevate directory permissions to 777 temporarily and demote them back to 755 after completing plugin installations.";
		$im_fileUploadsEn     = "File Uploads is Enabled - If you plan on using files larger than ". ini_get('upload_max_filesize') ." you may need to contact your host to raise this limit. Large file uploads may also need upload_max_filesize and post_max_size settings increased. For very large files it may also be necessary to increase max_execution_time and memory_limit settings. Alternatively you may need to use an external FTP program to upload files.";
		$im_fileUploadsDi     = "File Uploads is Disabled - You will not be able to upload files through Mambo Contact your host and ask if they can be enabled on your account."; 
        $disabledPHPFunctions = "For security or operation reasons your host has disabled the following PHP functions: ";
		$registerGlobalsON    = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>PHP <b>register_globals</b> is enabled, the security of your web site could be compromised. Refer to the Mambo Security Forum and FAQ's.";
		$magicQuotesOFF       = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>PHP <b>magic_quotes</b> is disabled, this is not essential for Mambo to function but aids in securing your web site to some degree.";
		$registerGlobalsOFF   = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>PHP <b>register_globals</b> is Disabled, this greatly increases the security of your website.";
		$magicQuotesON        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>PHP <b>magic_quotes</b> is Enabled, while not essential, this function aids in securing your web site.";
		$safeModeON           = "PHP <b>safe_mode</b> is enabled, this may impair your Mambo funcionality.";
		$safeModeOFF          = "PHP <b>safe_mode</b> is disabled, Mambo functionality should not be impaired by path accessibility issues.";
	    $wm_saveSessionNotSet = "Your PHP <b>save_session.path</b> variable appears not to be set by your host. You will most likely have Administrator login problems unless this is resolved.";
	    $am_saveSessionPErr   = "Either your PHP <b>save_session.path</b> has not been set up correctly or your host has safe_mode configured. You will need to contact your host regarding resolving this issue.";
	    $em_saveSessionNoWrite= "Your PHP <b>save_session.path</b> is not writable to you. You will most likely have Administrator login problems unless this is resolved.";
	    $am_saveSessionWErr   = "Either your PHP save_session.path directory does not have the correct write or execute permissions for you or your host has safe_mode configured. You will need to contact your host regarding resolving this issue.";
        $gm_saveSessionOK     = "Your PHP <b>save_session.path</b> is configured and is writable, you should not have any issues logging in the the Mambo Administration site.";
		$wm_absolutePath      = "Your Mambo <b>Absolute Path</b> appears to be incorrect, please check your configuration.php";
		$wm_cacheNotWrite     = "Mambo Caching has been enabled, but the selected path appears not to be writable.";
		$am_cacheNotWrite     = "Check that the selected directory (mosConfig_cachepath) in the configuration.php file, exists and is writable to the Web Server";
		$gm_cacheOK           = "Mambo Caching is enabled and the path is writable.";
		$wm_SEONoHTAccess     = "Mambo SEO (Search Engine Optimisation) has been enabled, but we could not find a .htaccess file, this will result in your site observing 'Error 500 Messages'.";
		$am_SEONoHTAccess     = "To fully Enable SEO you need to rename the htaccess.txt file in the Mambo '/' directory to <b>.htaccess</b>.";
		$am_NoHTAccess        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>To further protect your site from numerous types of exploits (even if you are not using SEO), rename the htaccess.txt file in the Mambo '/' directory to .htaccess (Apache Only!) Review the FAQ's on the Mambo Docs Site.";
		$gm_HTAccessOK        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>You have a .htaccess file in your Mambo '/' directory, if this is the Mambo htaccess.txt renamed, it is helping to protect your site from many known exploits.";
		$am_NoAdminHTAccess   = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>To further protect your administration site from unwanted access or exploit attempts, it is possible to password protect the directory or restrict access with a .htaccess file (Apache Only!). Review the FAQ.s on the Mambo Help Site.";
		$gm_AdminHTAccessOK   = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>You have a .htaccess file in your Mambo 'administrator/' directory, it is helping to protect your site from many known exploits.";
		$im_SEOProtect        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>Enabling SEO (Search Engine Optimisation) URL's can assist in protecting your site from possible exploit attacks.";
		$em_configWrite       = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>Your configuration.php file is <b>Writable</b>, for a production Mambo site this may lead to a compromise of the site.";
		$am_configWrite       = "It is a good practice to keep you configuration.php un-writable in production sites. We suggest changing the permissions to 644 or 444 to be safe.";
		$gm_configRead        = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>Your configuration.php file is <b>Read Only</b>, for a production Mambo site this is a best practice.";
		$im_PermWritable      = "The 'Writable' is used within Mambo instead of specifically stating required permission because the actual permissions required are determined by the server configuration. Writable simply means that the 'Web Server' process can write to the directory, what ever the mode site might actually be.<br /><br />This does not necessarily translate directly to a requirement to set 777 as the mode.<br /><br />If your host has an SuExec facility installed, a mode-set of 0755 should be adaqaute for Mambo to function fully.";
		$im_PermRef           = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>For additional information regarding Permissions, please refer to the following Mambo Forum Sections:<br /><br />Security & Performance<br />";
		$em_adminDefault      = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>The Super Administrator account name is still the default 'admin'.";
		$am_adminDefault      = "It is recommended that you rename the default Super Administrator for security reasons.";
		$gm_adminDefault      = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/apply_f2.png'>The default Super Administrator account has been renamed, this will improve your sites security to some degree against common usernames brute-force entry.";
		$wm_debugEnabled	  = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>One or more Debug Modes are <b>enabled</b>, if your template supports this feature, your production web site will be showing MySQL Query information to the public.";
		$am_debugEnabled	  = "To disable a Debug mode, either set the option to '0' in your configuration.php file or turn the Debug Off in the 'Global Configuration' ( <a href='".$mosConfig_live_site."/administrator/index2.php?option=com_config&hidemainmenu=1'>Here</a> )";
		$wm_badPorts		  = "<img align='right' style='margin-top: -24px; margin-right: -13px;' src='images/cancel.png'>Your host appears to have some potentially harmful ports online. They could be quite innocent, but it may be wise to query this port activity with your host.";
		$gm_badPorts		  = "No potentially harmful ports were found to be online. ( Tested Ports were : 6666, 6667 )";

/* Mambo Environment Messages */
		echo "<h3>Instance Messages</h3>";

		if ( $thisMVer != $latestMVer ) {
		  echo "<div class='msg-warn'>". $wm_MOutOfDate ."</div>";
		  echo "<div class='msg-advise'>". $am_MConsiderUpgrade ."</div>";
		  } else { echo "<div class='msg-good'>". $gm_MUpToDate ."</div>"; }

		if (($isV46) && ($thisMDevStat != 'Stable')) {
		  echo "<div class='msg-warn'>". $im_MNotStable ."</div>";
		  echo "<div class='msg-advise'>". $am_MStableUpgrade ."</div>";
		  }
			
		if ($isV46) {
		  if ( RG_EMULATION == "1" ) { 
		    echo "<div class='msg-error'>" . $RG_EmulationON ."</div>"; 
		    echo "<div class='msg-advise'>" . $am_RG_EmulationON ."</div>"; } 
			  else { echo "<div class='msg-good'>" . $RG_EmulationOFF ."</div>"; }
		}

/* Web Server Environment Messages */
		echo "<h3>Web Server Messages</h3>";
        if (function_exists( 'exec' )) { $ApacheAcc = exec("whoami"); $UserAcc = get_current_user (); }
        if ($ApacheAcc != $UserAcc) { echo "<div class='msg-warn'>" . $noSuExec ."</div>"; }
        if ($ApacheAcc != $UserAcc) { echo "<div class='msg-warn'>". $noSuExecWarn ."</div>"; }
        if ($ApacheAcc != $UserAcc) { echo "<div class='msg-advise'>". $noSuExecAdvice ."</div>"; }

        if (!is_writable( $sp )) {
	      echo "<div class='msg-error'>". $em_saveSessionNoWrite ."</div>";
	      echo "<div class='msg-advise'>". $am_saveSessionWErr ."</div>"; }


/* PHP Environment Messages */
		echo "<h3>PHP Messages</h3>";
		if (version_compare(phpversion(), $currentPHP, "<")) { echo "<div class='msg-advise'>". $wm_phpDownlevel ."</div>"; }

		if (version_compare(phpversion(), 5.0, "<")) { echo "<div class='msg-advise'>". $am_phpBelowFive ."</div>"; }

		if (ini_get('register_globals')) { echo "<div class='msg-error'>". $registerGlobalsON ."</div>"; } else {echo " <div class='msg-good'>". $registerGlobalsOFF ."</div>"; }
		if (!ini_get('magic_quotes_gpc')) { echo "<div class='msg-warn'>". $magicQuotesOFF ."</div>"; } else { echo "<div class='msg-good'>". $magicQuotesON ."</div>"; }

	    if (!$sp) { 
		  echo "<div class='msg-warn'>". $wm_saveSessionNotSet ."</div>";
	      echo "<div class='msg-advise'>". $am_saveSessionPErr ."</div>"; }
?>
      </td>
	  <td valign="top" style="padding-left: 3%; padding-right: 3%; padding-top: 0px;">


	  <table border="0" cellpadding="0" cellspacing="2" width="100%">
        <tr>
		  <td colspan="2"><h3>Mambo Instance Dashboard</h3></td>
	    </tr>
	    <tr>
      		<td valign="top" width="200" nowrap><strong>Mambo Version:</strong></td>
      		<td valign="top" class="data-container" align="center">
			<strong>
			<?php if ($isV46 == "1") { echo $version; } else { echo $version ."<br /><font color='red'>Unsupported Version</font>"; } ?>
			</strong>
			</td>
	    </tr>
		<tr>
		  <td valign="top"><strong>Installation Assessment:</strong></td>
		  <td valign="top">
		  

<!--// START SUCCESS SCALE //-->
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="data-container">
	<tr>
		<td align="center" valign="top">
		<br />

			<table border="0" cellspacing="1" cellpadding="1" width="85%" height="100%" align="center">
<?php
	$colorOnNone   = "#b22222";
	$colorOnLow    = "#990099";
	$colorOnMed    = "#0033ff";
	$colorOnGood   = "#33ffff";
	$colorOnHigh   = "#66cc00";
	$colorOff      = "#ffffff";

	$tally = 13;

	$total = 0;


	if (is_writable( $sp )) { ($total++); } else { $installNote .= "<b>save_session.path</b> is not writable. You may observe Administrator login issues.<br>"; }
	if (ini_get('display_errors')) { ($total++); }
	if (!ini_get('register_globals')) { ($total++); } else { ($total--); $installNote .= "<b><font color=#C64934>register_globals</b> is enabled, the security of your web site could be compromised. Refer to the Mambo</font> Security Forums.<br>";}
	if (!ini_get('safe_mode')) { ($total++); } else { $installNote .= "<b>safe_mode</b> is enabled, your installation may be troublesome. Refer to the Mambo Installation Forum.<br>"; }

	if (ini_get('file_uploads')) { ($total++); } else { $installNote .= "<b>file_uploads</b> is disabled, you will not be able to upload any files or install Extensions.<br>"; }
	if (ini_get('magic_quotes_gpc')) { ($total++); } else { $installNote .= "<b>magic_quotes</b> is disabled, this is not essential for Mambo to function but aids in securing your web site to some degree. Your installation can continue with this setting.<br>"; }
	if (!ini_get('magic_quotes_runtime')) { ($total++); }
	if (!ini_get('output_buffering')) { ($total++); }
	if (!ini_get('session_autostart')) { ($total++); } else { $installNote .= "<b>session_autostart</b> is enabled, you may observe eratic login behaviour.<br>"; }

// ShowStoppers - Sets Installation Assessment to 0%, not possible.
	if (extension_loaded('zlib')) { ($total++); } else { ($total = 0); $installNote .= "You do not have the <b>zlib library</b> loaded in PHP.<br>"; }
	if (extension_loaded('xml')) { ($total++); } else { ($total = 0); $installNote .= "You do not have the <b>xml library loaded</b> in PHP.<br>"; }
    if (function_exists( 'mysql_connect' )) { ($total++); } else { ($total = 0); $installNote .= "PHP does not have <b>MySQL support</b>.<br>"; }

	if ($isV46) {
		if (phpversion() > '4.3') { ($total++); } else { ($total = 0); $installNote .= "Your <b>PHP version</b> is not supported by Mambo v1.0<br>"; }
	} else { ($total = 0); $installNote .= "Unable to determine your version of PHP<br>"; }

//	echo "<tr><td class='title' colspan='15'>Installation Assessment</td></tr>";
	echo "<tr>";

	if ($total === 0) {
			echo "<td bgcolor='#ffffff' class='scale' style='border-left: 2px solid ".$colorOnNone.";'>&nbsp;</td>";

		for ($n=0; $n<($total-1); $n++) {
//		for ($n=0; $n<13; $n++) {
			echo "<td class='scale' bgcolor='#ffffff'>&nbsp;</td>";
		}

	} else {

		for ($i=0; $i<$total; $i++) {

			if ($i < 3) {
				echo "<td class='scale' bgcolor='". $colorOnNone ."'>&nbsp;</td>";
				} elseif ($i < 6) {
					echo "<td class='scale' bgcolor='". $colorOnLow ."'>&nbsp;</td>";	
					} elseif ($i < 9) {
						echo "<td class='scale' bgcolor='". $colorOnMed ."'>&nbsp;</td>";	
						} elseif ($i <= 11) {
							echo "<td class='scale' bgcolor='". $colorOnGood ."'>&nbsp;</td>";	
							} elseif ($i <= $total) {
								echo "<td class='scale' bgcolor='". $colorOnHigh ."'>&nbsp;</td>";	
			}

		}


		for ($i=$total; $i<$tally; $i++) {
			echo "<td class='scale' bgcolor='". $colorOff ."'> &nbsp;</td>";
		}


	}
echo "</tr>";

	$scaleSuccess = number_format(($total/$tally)*100,0);

/** Testing Scale Settings **/
//  Uncomment the following line and modify to test Scale Settings and Messages
//	$scaleSuccess = 45;

	echo "<tr><td colspan='13' align='center' class='rate' bgcolor='". $colorOff ."' style='text-align: center;'>Assessment Rating<br /><br /><span style='border: 1px solid #e6e6fa; background-color: #f0ffff; margin: 10px; padding: 5px; padding-left: 40px; padding-right: 40px; font-size: 14px;'>". $scaleSuccess ."%</span><br /><br /></td></tr>";

	if ($scaleSuccess <= 20) { $installMsg .= "It will not be possible to install or run Mambo at this time."; } 
			elseif ($scaleSuccess <= 30) { $installMsg = "Mambo is very unlikely to install or run under this configuration."; }
				elseif ($scaleSuccess <= 40) { $installMsg = "Mambo may install/run, however it is very unlikley to be functional."; }
					elseif ($scaleSuccess <= 50) { $installMsg = "Mambo may install or run, however functionailty will be severly hampered."; }
						elseif ($scaleSuccess <= 60) { $installMsg = "Mambo should probably install or run, but with reduced functionality."; }
							elseif ($scaleSuccess <= 70) { $installMsg = "Mambo should install or run, but the majority of features will not not function correctly."; }
								elseif ($scaleSuccess <= 80) { $installMsg = "Mambo should install or run, but some features will not function correctly."; }
									elseif ($scaleSuccess <= 90) { $installMsg = "Mambo should install or run, but you might have difficulty making use of some features."; }
										elseif ($scaleSuccess <= 95) { $installMsg = "Mambo should install or run, but you may observe a few minor difficulties with some features."; }
											elseif ($scaleSuccess > 95) { $installMsg = "Mambo should install or run, with no immediate issues. Enjoy your Mambo Experience."; }

		echo "<tr><td colspan='13' align='center'>";

		if ($scaleSuccess > 95) { echo "<div class='msg-good-scale'>". $installMsg ."</div>"; } 
			elseif ($scaleSuccess >= 81) { echo "<div class='msg-advise-scale'>". $installMsg ."</div>"; } 
				elseif ($scaleSuccess >= 41) { echo "<div class='msg-warn-scale'>". $installMsg ."</div>"; } 
					else { echo "<div class='msg-error-scale'>". $installMsg ."</div>"; }

		if ($total != $tally) { echo "<div class='msg-warn-scale'>". $installNote ."</div>"; }

	$lastRun = date('l dS \of F Y \@ H:i:s');

    $database->setQuery('UPDATE `#__mts`'
        .' SET lastrate='.$database->Quote(''. $scaleSuccess .''));
    $database->query();

    $database->setQuery('UPDATE `#__mts`'
        .' SET lastrun='.$database->Quote(''. $lastRun .''));
    $database->query();

		echo "</td></tr>";
?>

		</table>

	</td>
	</tr>
</table>
<!--// END SUCCESS SCALE //-->


		  </td>
		</tr>
                        <tr>
						    <td colspan="2"><h3>Host Environment Dashboard</h3></td>
						</tr>
                        <tr>
						    <td ><b>Hostname</b></td>
							<td class="data-container" width="65%"><?php echo @php_uname(n); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Host IP Address</td>
							<td class="data-container"><?php if (function_exists( 'shell_exec' )) { echo @gethostbyname(trim(`hostname`)); } else { echo  $_SERVER['SERVER_ADDR'] ." <b><font color='red'>*</font></b>"; } ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Platform</td>
							<td class="data-container"><?php echo @php_uname(s); ?> <?php echo @php_uname(r); ?> <?php echo @php_uname(v); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Architcture</td>
							<td class="data-container"><?php echo @php_uname(m); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Username</td>
							<td class="data-container"><?php echo get_current_user (); echo " ( UiD: ". getmyuid() .", GiD: ". getmygid() ." )";?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Current Path</td>
							<td class="data-container"><?php echo getcwd (); ?></td>
						</tr>


                        <tr>
						    <td colspan="2"><h3>Web Server Environment Dashboard</h3></td>
						</tr>
                        <tr>
						    <td><b>Server Version</b></td>
							<td class="data-container" width="65%"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Host</td>
							<td class="data-container"><?php echo $_SERVER['HTTP_HOST']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Document Root</td>
							<td class="data-container"><?php echo $_SERVER['DOCUMENT_ROOT']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Site IP Address</td>
							<td class="data-container"><?php echo $_SERVER['SERVER_ADDR']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Server Port</td>
							<td class="data-container"><?php echo $_SERVER['SERVER_PORT']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Server Account</td>
							<td class="data-container">
							<?php
							if (function_exists( 'passthru' )) {
							$UserAcc = get_current_user ();
								if ($ApacheAcc != $UserAcc) { $AccColor = "blue"; } else { $AccColor = "black"; }
								echo "<font color=\"". $AccColor ."\">";
									$ApacheAcc = passthru("whoami");
								echo "</font>";
							} else {
							echo "<i>". $obtainServerAccount ."</i>";
							}
							?>							
							</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Server Admin</td>
							<td class="data-container"><?php echo $_SERVER['SERVER_ADMIN']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Server Signature</td>
							<td class="data-container">
							<?php
                            if (!$_SERVER['SERVER_SIGNATURE']) { echo "<i>Administrator Obscured, this is not an error.</i>"; }
							  else { echo $_SERVER['SERVER_SIGNATURE']; }
							?>
							 </td>
						</tr>
                        <tr>
						    <td>&nbsp; - Server Protocol</td>
							<td class="data-container"><?php echo $_SERVER['SERVER_PROTOCOL']; ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Gateway Interface</td>
							<td class="data-container"><?php echo $_SERVER['GATEWAY_INTERFACE']; ?></td>
						</tr>


                        <tr>
						    <td colspan="2"><h3>PHP Environment Dashboard</h3></td>
						</tr>
                        <tr>
						    <td><b>PHP Version</b></td>
							<td class="data-container"><?php echo phpversion(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Include Files</td>
							<td class="data-container"><?php echo ini_get('include_path'); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - PHP API</td>
							<td class="data-container"><?php echo php_sapi_name(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - File Uploads</td>
							<td class="data-container"><?php if (ini_get('file_uploads') == "1") { echo "Enabled"; } else { echo "Disabled"; } ?></td>
						</tr>
						<!--// START Andys' Suggestions //-->
                        <tr>
						    <td>&nbsp; - Max. Upload Size</td>
							<td class="data-container"><?php echo ini_get('upload_max_filesize'); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Max. Post Size</td>
							<td class="data-container"><?php echo ini_get('post_max_size'); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Max. Execution Time</td>
							<td class="data-container"><?php echo ini_get('max_execution_time'); ?> seconds</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Max. Input Time</td>
							<td class="data-container"><?php echo ini_get('max_input_time'); ?> seconds</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Memory Limit</td>
							<td class="data-container"><?php echo ini_get('memory_limit'); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Zend Version</td>
							<td class="data-container"><?php echo zend_version(); ?>
							</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Disabled Functions</td>
							<td class="data-container">
							<?php
                            if (ini_get('disable_functions')) { echo (ini_get('disable_functions')); }
                            else if (!ini_get('disable_functions')) { echo "<i>There are no disabled functions.</i>"; }
							?>
							</td>
						</tr>


                        <tr>
						    <td colspan="2"><h3>MySQL Environment Dashboard</h3></td>
						</tr>
                        <tr>
						    <td><b>MySQL Server Version</b></td>
							<td class="data-container"><?php echo @mysql_get_server_info(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Client Version</td>
							<td class="data-container"><?php echo @mysql_get_client_info(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Host Info</td>
							<td class="data-container"><?php echo @mysql_get_host_info(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Protocol Version</td>
							<td class="data-container"><?php echo @mysql_get_proto_info(); ?></td>
						</tr>
                        <tr>
						    <td>&nbsp; - Client Character Set</td>
							<td class="data-container">
							<?php
							if (function_exists('mysql_client_encoding')) { 
							  $charset = mysql_client_encoding();
							  echo $charset;
							}
							?>
							</td>
						</tr>
                        <tr>
					        <td valign="top">&nbsp; - Statistics</td>
							<td class="data-container"valign="top">
							<?php 
							$status = explode('  ', @mysql_stat());
							  if (!$status[0]) { echo "<div class='small-disabled'>Unable to collect database statistics</div>"; } else {
							  //print_r($status);
								echo $status[0]."<br />";
								echo $status[1]."<br />";
								echo $status[2]."<br />";
								echo $status[3]."<br />";
								echo $status[4]."<br />";
								echo $status[5]."<br />";
								echo $status[6]."<br />";
								echo $status[7]."<br />";
							  }
							?>
							</td>
						</tr>
                        <tr>
					        <td valign="top">&nbsp; - Processes</td>
							<td class="data-container"valign="top">
							<?php 
							$result = @mysql_list_processes();
							  if (!$result) { echo "<div class='small-disabled'>Unable to collect to database processlist</div>"; } else {

							    while ($row = @mysql_fetch_assoc($result)){
                                  printf("%s %s %s %s %s\n", $row["Id"], $row["Host"], $row["db"],
                                  $row["Command"], $row["Time"]);
                                }
                                  mysql_free_result($result);
							  }
							?>
							</td>
						</tr>
	  </table>


	  </td>
      <td width="170" valign="top" style="padding-right: 15px;" class="right-col">

<!--// Server Services Environment //-->
	<?php
	if ($_GET['task'] == "mtsws") {
	echo "<h3>Service Status</h3>";


	$timeout = "1";
	$self = $_SERVER['SERVER_ADDR'];

		//set service checks
		$port[1] = "80";	$service[1] = "HTTP";		$address[1] =$self;
		$port[2] = "443";	$service[2] = "HTTPS";		$address[2] =$self;
		$port[3] = "21";	$service[3] = "FTP";		$address[3] =$self;
		$port[4] = "22";	$service[4] = "SSH/sFTP";	$address[4] =$self;
		$port[5] = "25";	$service[5] = "SMTP";		$address[5] =$self;
		$port[6] = "110";	$service[6] = "POP3";		$address[6] =$self;
		$port[7] = "143";	$service[7] = "IMAP";		$address[7] =$self;
		$port[8] = "3306";	$service[8] = "MYSQL";		$address[8] =$self;
		$port[9] = "80";	$service[9] = "mambo-foundation.org";	$address[9] ="mambo-foundation.org";

		//count arrays
		$ports = count($port);
		$ports = $ports + 1;
		$count = 1;

			$data .= "<table border='0' width='95%' cellspacing='1' cellpadding='1'><tr><th colspan='2' align='left'><b>This Server Services</b></th></tr>";

				while($count < $ports){

					if($address[$count]==""){ $address[$count] = ""; }

			        $fp = @fsockopen("$address[$count]", $port[$count], $errno, $errstr, $timeout);

// On & Offline Services Shown
        				if (!$fp) {
							$data .= "<tr><td class='data-container'>&nbsp;&nbsp;". $service[$count] ."</td><td class='right-col' align='center' width='15px'><img src='images/publish_r.png'></td></tr>";
							} else {
								$data .= "<tr><td class='data-container'>&nbsp;&nbsp;". $service[$count] ."</td><td class='right-col' align='center' width='15px'><img src='images/publish_g.png'></td></tr>";


// Only Online Services Shown...
//        				if ($fp) {
//								$data .= "<tr><td align='center' width='25px'><img src='images/uparrow.png'></td><td class='data-container'>". $service[$count] ."</td></tr>";

            				fclose($fp);
						}

				$count++;
				}

			$data .= "</table>";

			echo $data;

		echo "<br />";

		

// START Potentiall BAD Ports

		$badPort[1] = "6666";	$badService[1] = "IRC on 6666";	$badAddress[1] =$self;
		$badPort[2] = "6667";	$badService[2] = "IRC on 6667";	$badAddress[2] =$self;

		//count arrays
		$badPorts = count($badPort);
		$badPorts = $badPorts + 1;
		$badCount = 1;

			$badData .= "<table border='0' width='95%' cellspacing='1' cellpadding='1'><tr><th colspan='2' align='left'><b>Un-Expected Services</b></th></tr>";

				while($badCount < $badPorts){

					if($badAddress[$badCount]==""){ $badAddress[$badCount] = ""; }

			        $badfp = @fsockopen("$badAddress[$badCount]", $badPort[$badCount], $errno, $errstr, $timeout);

/// On & Offline Services Shown
///        				if (!$badfp) {
///							$badData .= "<tr><td class='data-container'>&nbsp;<img src='images/tick.png'>&nbsp;". $badService[$badCount] ."</td><td class='right-col' align='center' width='15px'><img src='images/downarrow.png'></td></tr>";
///							} else {
///								$badData .= "<tr><td class='data-container' style='border: 1px solid #F57900; border-left: 12px solid #F57900; background-color: #fffacd;'>&nbsp;<img src='../includes/js/ThemeOffice/warning.png'>&nbsp;". $badService[$badCount] ."</td><td class='right-col' align='center' width='15px'><img src='images/uparrow-1.png'></td></tr>";
///								$badPortMsg = 1;

// Only Online Services Shown...
        				if ($badfp) {
							$badData .= "<tr><td class='data-container' style='border: 1px solid #F57900; border-left: 12px solid #F57900; background-color: #fffacd;'>&nbsp;<img src='../includes/js/ThemeOffice/warning.png'>&nbsp;". $badService[$badCount] ."</td><td class='right-col' align='center' width='15px'><img src='images/uparrow-1.png'></td></tr>";
							$badPortMsg = 1;

            				fclose($badfp);
						} else {

/// Show Only Offline Services
///        				if (!$badfp) {
///							$badData .= "<tr><td class='data-container'>&nbsp;<img src='images/tick.png'>&nbsp;". $badService[$badCount] ."</td><td class='right-col' align='center' width='15px'><img src='images/downarrow.png'></td></tr>";
///							} else {
///								$badData .= "<tr><td class='data-container' style='border: 1px solid #F57900; border-left: 12px solid #F57900; background-color: #fffacd;'>&nbsp;<img src='../includes/js/ThemeOffice/warning.png'>&nbsp;". $badService[$badCount] ."</td><td class='right-col' align='center' width='15px'><img src='images/uparrow-1.png'></td></tr>";
///								$badPortMsg = 1;

						}

				$badCount++;
				}
			if ($badPortMsg == "1") {
			 $badData .= "<tr><td colspan='2'><div class='msg-warn'>". $wm_badPorts ."</div></td></tr>";
			} else {
			 $badData .= "<tr><td colspan='2'><div class='msg-good'>". $gm_badPorts ."</div></td></tr>";
			}
			$badData .= "</table>";

			echo $badData;

// END Potential BAD Ports


	  echo "<h3>Statistics</h3>";

			$data1 .= "<table width='95%' border='0' cellspacing='1' cellpadding='1'>";

			//Get The Server uptime & loads
			if (function_exists( 'exec' )) { $loadresult = @exec('uptime'); }
				else if (function_exists( 'passthru' )) { $loadresult = @passthru('uptime'); }
					else { echo "<tr><td colspan='2' class='right-col'>Unable to acquire statistics.</td></tr>"; }

			preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$loadresult,$avgs);

			$uptime = explode(' up ', $loadresult);
			$uptime = explode(',', $uptime[1]);
			$uptime = $uptime[0].', '.$uptime[1];

		// Don't Show for Windows Machines as they don't have the required functions....
		if (!$isWin == 'WIN') {
			$data1 .= "<tr><th align='left' colspan='2'><b>Load Averages</b>&nbsp;:&nbsp;</th></tr><tr><td class='right-col' colspan='2'>&nbsp;Previous: <br />&nbsp;&nbsp;&nbsp;&nbsp;1 minute&nbsp;&nbsp;:&nbsp;". $avgs[1] ."<br />&nbsp;&nbsp;&nbsp;&nbsp;5 minutes:&nbsp;". $avgs[2] ."<br />&nbsp;&nbsp;15 minutes:&nbsp;". $avgs[3] ."</td></tr>\n";
			$data1 .= "<tr><th align='left' colspan='2'><b>UpTime</b>&nbsp;:&nbsp;</th></tr><tr><td class='right-col' colspan='2'>&nbsp;Up: ". $uptime ."</td></tr>";
//			$data1 .= "</table>";
		} else {
			$data1 .= "<tr><th align='left' colspan='2'><b>Load Averages</b>&nbsp;:&nbsp;</th></tr><tr><td class='right-col' colspan='2'>&nbsp;&nbsp;N/A for Windows</td></tr>\n";
			$data1 .= "<tr><th align='left' colspan='2'><b>UpTime</b>&nbsp;:&nbsp;</th></tr><tr><td class='right-col' colspan='2'>&nbsp;&nbsp;N/A for Windows</td></tr>";
//			$data1 .= "</table>";
		} // End isWin
		echo $data1;

	echo "<tr><th colspan='2' align='left'><b>Capacity</b> :</th></tr>";
	echo "<tr><td class='data-container'>Total Disk Space:</td><td class='right-col'>";
		if (function_exists('disk_total_space')) {
		$diskusage = round((disk_total_space("."))/(1024*1024));
			echo round($diskusage/1024)." GB";
		} else {
			echo "Not Supported.";
		}
	echo "</td></tr>";

	echo "<tr><td class='data-container'>Free Disk Space:</td><td class='right-col'>";
		if (function_exists('disk_free_space')) {
		$diskusage = round((disk_free_space("."))/(1024*1024));
			echo round($diskusage/1024)." GB";
		} else {
			echo "Not Supported.";
		}
	echo "</td></tr>";

	echo "<tr><td class='data-container'>Used Memory:</td><td class='right-col'>";
		if (function_exists('memory_get_usage') && function_exists('ini_get')) {
			$memusage=(memory_get_usage())/1024;
				printf (" %d kB", $memusage);
		} else {
			echo "Not Supported.";
		}
	echo "</td></tr>";

	echo "<tr><td class='data-container'>Free Memory:</td><td class='right-col'>";
		if (function_exists('memory_get_usage') && function_exists('ini_get')) {
			$memusage=(memory_get_usage())/1024;
			$memory=(ereg_replace("[A-Za-z]","",ini_get('memory_limit')))*1024;
			$freemem=$memory-$memusage;
				printf (" %d kB", $freemem);
		} else {
			echo "Not Supported.";
		}
	echo "</td></tr>";
	echo "</table>";


	} // if jtsws
	?>


	  <h3>Information</h3>	
<!--// Mambo Environment Information //-->

<!--// Web Server Environment Messages //-->
  	  <div class="msg-info"><?php echo $im_webserverVIP; ?></div>
	  <div class="msg-info"><?php echo $im_webserverDocRoot; ?></div>
	  <?php
        if (!function_exists( 'shell_exec' )) { echo "<div class='msg-info'>". $shellExecDisabled ."</div>"; }
        if (!function_exists( 'exec' )) { echo "<div class='msg-info'>". $execDisabled ."</div>"; }
        if (!function_exists( 'passthru' )) { echo "<div class='msg-info'>". $passthruDisabled ."</div>"; }
		?>

<!--// PHP Environment Messages //-->
  	  <?php
	  if (ini_get('file_uploads')) { echo "<div class='msg-info'>". $im_fileUploadsEn ."</div>"; } else { echo "<div class='msg-info'>". $im_fileUploadsDi ."</div>"; }
	  if (ini_get('disable_functions')) { echo "<div class='msg-info'>". $disabledPHPFunctions ."<br />". (ini_get('disable_functions')) ."</div>"; } 
	  ?>

	  </td>
    </tr>
</table>

<!--// END HISA TAB //-->







<!--// START Mambo TAB //-->
		<?php
		$tabs->endTab();
		$tabs->startTab("Mambo","mambo-page");
		?>



<table border='0' cellspacing='2' cellpadding='2' id='jts-container' class="adminform">
  <tr>
    <th colspan="3">
      Mambo Configuration Audit
    </th>
  </tr>
	<tr>
      <td width="170" valign="top" style="padding-left: 15px;" class="left-col">

		<?php
		// CONSTANTS

		// MESSAGES
		/** Messages
		* $im_ = Informaitonal Message
		* $am_ = Advisory Message
		* $gm_ = Good Message
		* $wm_ = Warning Message
		* $em_ = Error Message
		**/


/* Mambo Environment Messages */
		echo "<h3>Security Messages</h3>";
		if (!is_writable( $mosConfig_absolute_path .'/configuration.php' )) { echo "<div class='msg-good'>" . $gm_configRead ."</div>"; } else { echo "<div class='msg-error'>" . $em_configWrite ."</div> <div class='msg-advise'>" . $am_configWrite ."</div>"; }

		if ($isV10) {
			if ( RG_EMULATION == "1" ) { 
			  echo "<div class='msg-error'>" . $RG_EmulationON ."</div>"; 
			  echo "<div class='msg-advise'>" . $am_RG_EmulationON ."</div>"; } 
			    else { echo "<div class='msg-good'>" . $RG_EmulationOFF ."</div>"; }
		}

		if (ini_get('register_globals')) { echo "<div class='msg-error'>". $registerGlobalsON ."</div>"; } else {echo " <div class='msg-good'>". $registerGlobalsOFF ."</div>"; }
		if (!ini_get('magic_quotes_gpc')) { echo "<div class='msg-warn'>". $magicQuotesOFF ."</div>"; } else { echo "<div class='msg-good'>". $magicQuotesON ."</div>"; }

		if (file_exists($mosConfig_absolute_path .'/.htaccess')) { echo "<div class='msg-good'>". $gm_HTAccessOK ."</div>"; } // else { echo "<div class='msg-advise'>". $am_NoHTAccess ."</div>"; }
		if (file_exists($mosConfig_absolute_path .'/administrator/.htaccess')) { echo "<div class='msg-good'>". $gm_AdminHTAccessOK ."</div>"; } // else { echo "<div class='msg-advise'>". $am_NoAdminHTAccess ."</div>"; }

		$jtsAdminquery = "SELECT * FROM ".$mosConfig_dbprefix."users WHERE usertype = 'Super Administrator'";
		$jtsAdminresult = mysql_query ($jtsAdminquery);
		while ( $jtsAdmin = mysql_fetch_array($jtsAdminresult) ) {
			if ($jtsAdmin['username'] == "admin") { 
				$adminExist = 1;
				echo "<div class='msg-error'>". $em_adminDefault ."</div><div class='msg-advise'>". $am_adminDefault ."</div>"; } else { echo "<div class='msg-good'>". $gm_adminDefault ."</div>";
			}
		}


/* Configuration Messages */
		echo "<h3>Config Messages</h3>";
		if (ini_get('safe_mode')) { echo "<div class='msg-warn'>". $safeModeON ."</div>"; } else { echo "<div class='msg-good'>". $safeModeOFF ."</div>"; }

	    if (!$sp) { 
		  echo "<div class='msg-warn'>". $wm_saveSessionNotSet ."</div>";
	      echo "<div class='msg-advise'>". $am_saveSessionPErr ."</div>"; }

        if (!is_writable( $sp )) {
	      echo "<div class='msg-error'>". $em_saveSessionNoWrite ."</div>";
	      echo "<div class='msg-advise'>". $am_saveSessionWErr ."</div>"; }

        if (($sp) && (is_writable( $sp ))) { echo "<div class='msg-good'>". $gm_saveSessionOK ."</div>"; }

		if (($mosConfig_caching == "1") && (!is_writable( $mosConfig_cachepath ))) { echo "<div class='msg-warn'>". $wm_cacheNotWrite ."</div> <div class='msg-advise'>". $am_cacheNotWrite ."</div>";  } 
	  	if (($mosConfig_sef == "1") && (!file_exists($mosConfig_absolute_path .'/.htaccess')) && ($isV10 == "1")) { echo "<div class='msg-error'>". $wm_SEONoHTAccess ."</div> <div class='msg-advise'>". $am_SEONoHTAccess ."</div>"; }

		if (($mosConfig_debug == "1") || ($mosConfig_debug_db == "1") || ($mosConfig_debug_lang == "1")) { echo "<div class='msg-warn'>". $wm_debugEnabled ."</div><div class='msg-advise'>". $am_debugEnabled ."</div>"; }
		
		?>
      </td>
	  <td valign="top" style="padding-left: 3%; padding-right: 3%; padding-top: 0px;">



	  <table border="0" cellpadding="0" cellspacing="2" width="100%">
        <tr>
		  <td colspan="2"><h3>Mambo User Dashboard</h3></td>
	    </tr>
	    <tr>
      		<td valign="top" width="200" nowrap><strong>Mambo Version:</strong></td>
      		<td valign="top" class="data-container"><?php if ($isV46) { echo $version; } else { echo "Unsupported Version"; } ?></td>
	    </tr>

			<tr>
				<td colspan="2" style="height: 25px;">
				</td>
			</tr>

			<tr>
				<td valign="top"><b>Super User Account Status</b></td>
				<td class="data-container">
				<?php
				if ($adminExist != "1") {
					echo "<font color='green'>Default Super Administrator Renamed</font> <i>...the user \"admin\" does not exist.</i>"; 
					} else {
						echo "<font color='red'>Default Super Administrator Exists</font> <i>...the user \"admin\" should be renamed immediately.</i>"; 
				}
				?>
				</td>
			</tr>

			<tr>
				<td><b>Configuration File Status</b></td>
				<td class="data-container">
				<?php
					if (!is_writable( $mosConfig_absolute_path .'/configuration.php' )) {
						echo "<font color='green'>Read Only</font> <i>configuration.php is not writable.</i>"; 
					} else {
						echo "<font color='red'>Read/Write</font> <i>configuration.php is writable.</i>"; 
					}
				?>
				</td>
			</tr>

			<tr>
				<td colspan="2" style="height: 25px;">
				</td>
			</tr>

                        <tr>
						    <td>&nbsp; - Site Status</td>
							<td class="data-container">
							<?php 
								if ($mosConfig_offline == "1") {
								  echo $mosConfig_sitename ." is <font color='red'>Offline</font>";
								  } else { echo $mosConfig_sitename ." is <font color='green'>Online</font>"; }
							?>
							</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Live Site URL</td>
							<td class="data-container"><font color="navy"><?php echo $mosConfig_live_site; ?></font></td>
						</tr>
                        <tr>
						    <td valign="top">&nbsp; - Absolute Path</td>
							<td class="data-container">
							<?php 
							$actualPath = dirname(__FILE__) . '/';
							$actualPath = str_replace('\\', '/', $actualPath);
							$upDir = substr( $actualPath, 0, strrpos( $actualPath, '/') );
							$actualPath = substr( $upDir, 0, strrpos( $upDir, '/') );
							$upDir = substr( $actualPath, 0, strrpos( $actualPath, '/') );
							$actualPath = substr( $upDir, 0, strrpos( $upDir, '/') );
							//echo $actualPath."<hr><br>";

							if ($isWin == 'WIN') {
								if (strcasecmp($actualPath, $mosConfig_absolute_path) != 0) {
//								if ($actualPath != $mosConfig_absolute_path) { 
									echo "<font color='navy'>".$mosConfig_absolute_path."</font><br /><font color='red'>". $wm_absolutePath ."</font>"; 
									echo "<br />Expected Path: <font color='green'>". $actualPath ."</font>";
									} else { 
									echo "<font color='navy'>". $mosConfig_absolute_path."</font>"; 
								}

							} else {

//								if (strcasecmp($actualPath, $mosConfig_absolute_path) == 1) {
								if ($actualPath != $mosConfig_absolute_path) { 
									echo "<font color='red'>".$mosConfig_absolute_path."<br />". $wm_absolutePath ."</font>"; 
									echo "<br /><font color='blue'>". $actualPath ."</font>";
									} else { 
									echo "<font color='blue'>". $mosConfig_absolute_path."</font>"; 
								}
							}
							?>
							</td>
						</tr>
                        <tr>
						    <td valign="top">&nbsp; - Mambo Cache</td>
							<td class="data-container">
							<?php 
								if ($mosConfig_caching == "1") {
									echo "<font color='green'>Enabled</font>";


										if (!is_writable( $mosConfig_cachepath )) {
											echo "&nbsp;&nbsp;( <font color='red'>Not Writable</font> )"; 
											} else { 
												echo "&nbsp;&nbsp;( <font color='green'>Writable</font> )"; 
										}
										echo "<br>".$mosConfig_cachepath; 

								} else { echo "Disabled"; }

							?>
							</td>
						</tr>
                        <tr>
						    <td>&nbsp; - Mambo SEO </td>
							<td class="data-container">
							<?php 

								if ($mosConfig_sef == "1") {
								  	if (!file_exists($mosConfig_absolute_path .'/.htaccess')) {
								  		echo "<font color='red'>Enabled, <i>but a .htaccess file is not present. See Messages.</i></font>"; 
									} else {
										echo "<font color='green'>Enabled</font> <i>.htaccess found.</i>";
									}
								} else { echo "Disabled"; }
							?>
							</td>
						</tr>
                       <tr>
						    <td valign="top">&nbsp; - htaccess Protection</td>
							<td class="data-container">
							<?php
//							if ($isWin == 'WIN') {
//							echo "<i>Apache .htaccess files might not be supported on this platform.</i>";
//							} else {

							  	if (file_exists($mosConfig_absolute_path .'/.htaccess')) {
								echo "<b>Mambo \"/\"</b> : <font color='green'>Enabled</font> <i>a .htaccess file was found.</i>"; 
										} else {
										echo "<b>Mambo \"/\"</b> : <font color='red'>Disabled</font> <i>a .htaccess file was not found.</i>";
								}
								echo "<br />";
							  	if (file_exists($mosConfig_absolute_path .'/administrator/.htaccess')) {
								echo "<b>Mambo \"administrator/\"</b> : <font color='green'>Enabled</font> <i>a .htaccess file was found.</i>"; 
										} else {
										echo "<b>Mambo \"administrator/\"</b> : <font color='red'>Disabled</font> <i>a .htaccess file was not found.</i>";
								}

//							}
							?>							
							</td>
						</tr>

                        <tr>
						    <td valign="top">&nbsp; - Debug Status</td>
							<td class="data-container">
							<?php 
							if ($mosConfig_debug == "1") {
							  echo "Site Debug is <font color='red'>Enabled</font> <i>...are you sure you need this enabled?</i>";
							  } else { echo "Site Debug is <font color='green'>Disabled</font>"; }
							?>
							</td>
						</tr>

		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td><strong>User Agent:</strong></td>
			<td class="data-container"><?php echo phpversion() <= '4.3.0' ? getenv( 'HTTP_USER_AGENT' ) : $_SERVER['HTTP_USER_AGENT'];?></td>
		</tr>
		<tr>
			<td><strong>User IP Address:</strong></td>
			<td class="data-container">
			<?php
				$userIP = getenv("REMOTE_ADDR");
				echo $userIP;
			?>
			</td>
		</tr>
		<tr>
			<td valign="top"><strong>Headers:</strong></td>
			<td class="data-container">
			<?php 
			if (function_exists( 'headers_list' )) { echo var_dump(headers_list()); } else { echo "<i>PHP5 Only Function</i>"; }
			?></td>
		</tr>



        <tr>
		  <td colspan="2"><h3>Mambo PHP Settings Dashboard</h3></td>
	    </tr>
			<tr>
				<td valign="top"><strong>Relevant Settings:</strong></td>
				<td>

					<table cellspacing="1" cellpadding="1" border="0" class="data-container" width="100%">
					<?php if ($isV10) { ?>
					<tr>
						<td width="200">
							Mambo Register Globals Emulation:
						</td>
						<td style="font-weight: bold;" width="50">
							<?php echo ((RG_EMULATION) ? '<span style="color: red;">ON</span>' : '<span style="color: green;">OFF</span>'); ?>
						</td>
						<td>
							<?php $img = ((RG_EMULATION) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<?php } ?>
					<tr>
						<td>
							Register Globals:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('register_globals',1,0); ?>
						</td>
						<td>
							<?php $img = ((ini_get('register_globals')) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<tr>
						<td>
							Magic Quotes:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('magic_quotes_gpc',1,1); ?>
						</td>
						<td>
							<?php $img = (!(ini_get('magic_quotes_gpc')) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<tr>
						<td>
							Safe Mode:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('safe_mode',1,0); ?>
						</td>
						<td>
							<?php $img = ((ini_get('safe_mode')) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<tr>
						<td>
							File Uploads:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('file_uploads',1,1); ?>
						</td>
						<td>
							<?php $img = ((!ini_get('file_uploads')) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<tr>
						<td>
							Session auto start:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('session.auto_start',1,0); ?>
						</td>
						<td>
							<?php $img = ((ini_get('session.auto_start')) ? 'publish_x.png' : 'tick.png'); ?>
							<img src="../images/<?php echo $img; ?>" />
						</td>
					</tr>
					<tr>
						<td>
							Session save path:
						</td>
						<td style="font-weight: bold;" colspan="2">
							<?php echo (($sp=ini_get('session.save_path'))?$sp:'none'); ?>
						</td>
					</tr>
					<tr>
						<td>
							Short Open Tags:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('short_open_tag'); ?>
						</td>
						<td>
						</td>
					</tr>
					<tr>
						<td>
							Output Buffering:
						</td>
						<td style="font-weight: bold;">
							<?php echo HTML_admin_misc::get_php_setting('output_buffering'); ?>
						</td>
						<td>
						</td>
					</tr>
					<tr>
						<td>
							Open basedir:
						</td>
						<td style="font-weight: bold;" colspan="2">
							<?php echo (($ob = ini_get('open_basedir')) ? $ob : 'none'); ?>
						</td>
					</tr>
					<tr>
						<td>
							Display Errors:
						</td>
						<td style="font-weight: bold;" colspan="2">
							<?php echo HTML_admin_misc::get_php_setting('display_errors'); ?>
						</td>
					</tr>
					<tr>
						<td>
							XML enabled:
						</td>
						<td style="font-weight: bold;" colspan="2">
						<?php echo extension_loaded('xml')?'<span style="color: green;">Yes</font>':'<span style="color: red;">No</font>'; ?>
						</td>
					</tr>
					<tr>
						<td>
							Zlib enabled:
						</td>
						<td style="font-weight: bold;" colspan="2">
							<?php echo extension_loaded('zlib')?'<span style="color: green;">Yes</font>':'<span style="color: red;">No</font>'; ?>
						</td>
					</tr>
					<tr>
						<td>
							Disabled Functions:
						</td>
						<td style="font-weight: bold;" colspan="2">
							<?php echo (($df=ini_get('disable_functions'))?$df:'none'); ?>
						</td>
					</tr>
					</table>
				</td>
			</tr>

			<tr>
				<td colspan="2" style="height: 25px;">
				</td>
			</tr>
			<tr>
				<td valign="top">
					<strong>Configuration File:</strong>
				</td>
				<td class="data-container">
				<?php
					$cf = file( $mosConfig_absolute_path . '/configuration.php' );
					foreach ($cf as $k=>$v) {
						if (eregi( 'mosConfig_host', $v)) {
							$cf[$k] = '$mosConfig_host = \'xxxxxx\'';
						} else if (eregi( 'mosConfig_user', $v)) {
							$cf[$k] = '$mosConfig_user = \'xxxxxx\'';
						} else if (eregi( 'mosConfig_password', $v)) {
							$cf[$k] = '$mosConfig_password = \'xxxxxx\'';
						} else if (eregi( 'mosConfig_db ', $v)) {
							$cf[$k] = '$mosConfig_db = \'xxxxxx\'';
						}
					}
					foreach ($cf as $k=>$v) {
						$k = htmlspecialchars( $k );
						$v = htmlspecialchars( $v );
						$cf[$k]=$v;
					}
					echo implode( "<br />", $cf );

				?>

				</td>
			</tr>
			</table>

			

	  </td>
      <!--// RIGHT COLUMN //-->
      <td width="170" valign="top" style="padding-right: 15px;" class="right-col">
	  <h3>Information</h3>
	  <?php
		if (!file_exists($mosConfig_absolute_path .'/.htaccess')) { echo "<div class='msg-info'>". $am_NoHTAccess ."</div>"; }
		if (!file_exists($mosConfig_absolute_path .'/administrator/.htaccess')) { echo "<div class='msg-info'>". $am_NoAdminHTAccess ."</div>"; }
		if ($mosConfig_sef == "0") { echo "<div class='msg-info'>". $im_SEOProtect ."</div>"; }
	  ?>
	  </td>
    </tr>
</table>
<!--// END Mambo TAB //-->






<!--// START PHP TAB //-->
		<?php
		$tabs->endTab();
		$tabs->startTab('PHP','php');
		?>

			<table class="adminform" width="95%">
			<tr>
				<th colspan="2">
					PHP Information
				</th>
			</tr>
			<tr>
				<td>
				<?php
				ob_start();
				phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
				$phpinfo = ob_get_contents();
				ob_end_clean();
				preg_match_all('#<body[^>]*>(.*)</body>#siU', $phpinfo, $output);
				$output = preg_replace('#<table#', '<table class="adminlist" align="center"', $output[1][0]);
				$output = preg_replace('#(\w),(\w)#', '\1, \2', $output);
				$output = preg_replace('#border="0" cellpadding="3" width="600"#', 'border="0" cellspacing="1" cellpadding="2" width="95%"', $output);
				$output = preg_replace('#<hr />#', '', $output);
				echo $output;
				?>
				</td>
			</tr>
			</table>

		<?php
		$tabs->endTab();
		$tabs->startTab('Permissions','perms');
		?>

<table border='0' cellspacing='2' cellpadding='2' id='jts-container' class="adminform">
  <tr>
    <th colspan="3">
      Mambo Directory Permissions
    </th>
  </tr>
	<tr>
      <td width="170" valign="top" style="padding-left: 15px;" class="left-col">

		<?php
		// CONSTANTS

		// MESSAGES
		/** Messages
		* $im_ = Informaitonal Message
		* $am_ = Advisory Message
		* $gm_ = Good Message
		* $wm_ = Warning Message
		* $em_ = Error Message
		**/
/* Configuration Messages */
		echo "<h3>Directory Messages</h3>";
				?>
		<div class="msg-advise">
			<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="2" style="font-size: 9px; vertical-align: top;"><b>Web Server:</b></td>
			</tr>
			<tr>
				<td width="20%" style="color: red; font-size: 9px; vertical-align: top;">UnWritable</td>
				<td width="80%" style="font-size: 9px; vertical-align: top;">The Directory is <b>UnWritable</b> to the Web Server, some Mambo functionality might be adversly effected, but site security has not been compromised.</td>
			</tr>
			<tr>
				<td width="20%" style="color: green; font-size: 9px; vertical-align: top;">Writable</td>
				<td width="80%" style="font-size: 9px; vertical-align: top;">The Directory is <b>Writable</b> to the Web Server, Mambo functionality for this directory should operate well. However, you should also review the <b>Mode</b> to determine if security might be comprised for functionality. <i>(Default Unix mode/permissions of 755 are normally considered 'sane'.)</i></td>
			</tr>
			</table>
			</div>

		<div class="msg-advise">
			<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="2" style="font-size: 9px; vertical-align: top;"><b>Mode Security:</b></td>
			</tr>
			<tr>
				<td width="20%" style="color: red; font-size: 9px; vertical-align: top;">RED</td>
				<td width="80%" style="font-size: 9px; vertical-align: top;">The Directory is <b>World Writable</b>, this may expose your site to unwanted access or exploits. Refer to the Mambo Security Forums</a></td>
			</tr>
			<tr>
				<td width="20%" style="color: blue; font-size: 9px; vertical-align: top;">BLUE</td>
				<td width="80%" style="font-size: 9px;" vertical-align: top;>No &quot;Execute&quot; or &quot;Read&quot; bit set, file execution may be problematic in this directory</td>
			</tr>
			<tr>
				<td width="20%" style="color: green; font-size: 9px; vertical-align: top;">GREEN</td>
				<td width="80%" style="font-size: 9px; vertical-align: top;">These permissions are reasonably sane, but may still require review. If the default Unix directory Mode of 0755 is also observed, there is no need to elevate permissions.</td>
			</tr>
			</table>
			</div>

      </td>
	  <td valign="top" style="padding-left: 3%; padding-right: 3%; padding-top: 0px;">


	  <table border="0" cellpadding="2" cellspacing="0" width="100%">
        <tr>
		  <td colspan="2"><h3>Mambo Directory Requirements Dashboard</h3>
		  For <b>all</b> Mambo functions and features to work <b>ALL</b> of the following directories should be writeable: <i>(Refer Information)</i>
		  <br /><br />
		  </td>
	    </tr>
					<tr>
						<th>Directory</th>
						<th align="right">Web-Server&nbsp;&nbsp;</th>
						<th align="center">Mode</th>
					</tr>



					<?php
					$sp = ini_get('session.save_path');

						writableCell( 'administrator/backups' );
						writableCell( 'administrator/components' );
						writableCell( 'administrator/modules' );
						writableCell( 'administrator/templates' );
						writableCell( 'cache' );
						writableCell( 'components' );
						writableCell( 'images' );
						writableCell( 'images/banners' );
						writableCell( 'images/stories' );
						writableCell( 'language' );
						writableCell( 'language' );
						writableCell( 'mambots' );
						writableCell( 'mambots/content' );
						writableCell( 'mambots/editors' );
						writableCell( 'mambots/editors-xtd' );
						writableCell( 'mambots/search' );
						writableCell( 'media' );
						writableCell( 'modules' );
						writableCell( 'templates' );
						writableCell( 'uploadfiles' );
					mosHTML::writableCell( $sp, 0, '<strong>Session Directory</strong> ' );

					?>
			</table>


	  </td>
      <!--// RIGHT COLUMN //-->
      <td width="170" valign="top" style="padding-right: 15px;" class="right-col">
	  <h3>Information</h3>
      <?php
        if (function_exists( 'exec' )) { 
		  $ApacheAcc = exec("whoami"); $UserAcc = get_current_user (); 
		  
            if ($ApacheAcc != $UserAcc) { echo "<div class='msg-warn'>User Account: ". $UserAcc ."<br />WebServer Account: ". $ApacheAcc ."<br />It appears your host is not using an SuExec Facility.</div>"; } else { echo "<div class='msg-good'>It appears that your WebServer Account and User are the same, you are most likely running an SuExec Facility, 0755 mode-set should be adaquate.</div>"; }
        }

	    if ((!function_exists( 'exec' )) && (function_exists( 'passthru' ))) { 
		  $ApacheAcc = passthru("whoami"); $UserAcc = get_current_user (); 
		  
            if ($ApacheAcc != $UserAcc) { echo "<div class='msg-warn'>User Account: ". $UserAcc ."<br />WebServer Account: ". $ApacheAcc ."<br />It appears your host is not using an SuExec Facility.</div>"; } else { echo "<div class='msg-good'>It appears that your WebServer Account and User are the same, you are most likely running an SuExec Facility, 0755 mode-set should be adaquate.</div>"; }
        }

		echo "<div class='msg-info'>". $im_PermWritable ."</div>";
		echo "<div class='msg-info'>". $im_PermRef ."</div>";
	  ?>
	  </td>
    </tr>
</table>






		<?php
		$tabs->endTab();
		$tabs->startTab('DataBase','dbase');
		?>
<!--// START DATABASE TAB //-->


<table border='0' cellspacing='2' cellpadding='2' id='jts-container' class='adminform'>
  <tr>
    <th colspan="3">
      Mambo Configuration Audit
    </th>
  </tr>
	<tr>
      <td width="170" valign="top" style="padding-left: 15px;" class="left-col">

		<?php
		// CONSTANTS

		// MESSAGES
		/** Messages
		* $im_ = Informaitonal Message
		* $am_ = Advisory Message
		* $gm_ = Good Message
		* $wm_ = Warning Message
		* $em_ = Error Message
		**/


/* Mambo Environment Messages */
		echo "<h3>Security Messages</h3>";
?>
      </td>
	  <td valign="top" style="padding-left: 3%; padding-right: 3%; padding-top: 0px;">




	  <table border="0" cellpadding="0" cellspacing="2" width="100%">
        <tr>
		  <td colspan="2"><h3>Mambo DataBase Dashboard</h3></td>
	    </tr>
	<tr>
		<td><b>MySQL Host</b></td><td class="data-container"><?php echo $mosConfig_host; ?></td>
	</tr>
    <tr>
	    <td><b>Server Version</b></td>
		<td class="data-container"><?php echo @mysql_get_server_info(); ?></td>
	</tr>
    <tr>
	    <td>&nbsp; - Client Version</td>
		<td class="data-container"><?php echo @mysql_get_client_info(); ?></td>
	</tr>
    <tr>
	    <td>&nbsp; - Host Information</td>
		<td class="data-container"><?php echo @mysql_get_host_info(); ?></td>
	</tr>
    <tr>
	    <td>&nbsp; - Protocal Version</td>
		<td class="data-container"><?php echo @mysql_get_proto_info(); ?></td>
	</tr>


			<?php

			$dba = @mysql_select_db( $mosConfig_db )
			  or die("Couldn't select the database.");


			$tablenames = array(
								''. $mosConfig_dbprefix .'banner',
								''. $mosConfig_dbprefix .'bannerclient',
								''. $mosConfig_dbprefix .'bannerfinish',
								''. $mosConfig_dbprefix .'categories',
								''. $mosConfig_dbprefix .'components',
								''. $mosConfig_dbprefix .'contact_details',
								''. $mosConfig_dbprefix .'containers',
								''. $mosConfig_dbprefix .'content',
								''. $mosConfig_dbprefix .'content_frontpage',
								''. $mosConfig_dbprefix .'content_rating',
								''. $mosConfig_dbprefix .'core_acl_aro',
								''. $mosConfig_dbprefix .'core_acl_aro_groups',
								''. $mosConfig_dbprefix .'core_acl_aro_sections',
								''. $mosConfig_dbprefix .'core_acl_groups_aro_map',
								''. $mosConfig_dbprefix .'core_log_items',
								''. $mosConfig_dbprefix .'core_log_searches',
								''. $mosConfig_dbprefix .'groups',
								''. $mosConfig_dbprefix .'mambots',
								''. $mosConfig_dbprefix .'menu',
								''. $mosConfig_dbprefix .'messages',
								''. $mosConfig_dbprefix .'messages_cfg',
								''. $mosConfig_dbprefix .'modules',
								''. $mosConfig_dbprefix .'modules_menu',
								''. $mosConfig_dbprefix .'newsfeeds',
								''. $mosConfig_dbprefix .'parameters',
								''. $mosConfig_dbprefix .'poll_data',
								''. $mosConfig_dbprefix .'poll_date',
								''. $mosConfig_dbprefix .'poll_menu',
								''. $mosConfig_dbprefix .'polls',
								''. $mosConfig_dbprefix .'sections',
								''. $mosConfig_dbprefix .'session',
								''. $mosConfig_dbprefix .'stats_agents',
								''. $mosConfig_dbprefix .'template_positions',
								''. $mosConfig_dbprefix .'templates_menu',
								''. $mosConfig_dbprefix .'users',
								''. $mosConfig_dbprefix .'usertypes',
								''. $mosConfig_dbprefix .'weblinks'
								);
				?>


				<tr><td height="20px;" colspan="2">&nbsp;</td></tr>
        <tr>
		  <td colspan="2"><h3>Mambo Table Status Dashboard</h3></td>
	    </tr>
				<tr>
				  <th align="left">Table Name</th>
				  <th align="left">Table Status</th>
				</tr>
				<?php
				 foreach($tablenames as $table){
					$result = mysql_query("SHOW TABLES LIKE '". $table ."'");
						$tablecheck = "CHECK TABLE ". $table ."";
						$chkresult = mysql_query($tablecheck);
						$check = (mysql_num_rows($chkresult));

							if(!$check == 'OK') {// table needs repair
								$chkMsgBad = "&nbsp;( <font color='red'>Needs Repair</font> )";
							} else { 
								$chkMsg = "&nbsp;( <font color='green'>Integrity OK</font> )"; 
							}

					echo (mysql_num_rows($result)) ? '<tr><td style="font-size: 11px;"> &nbsp;&nbsp;'. $table .' </td><td class="data-container"> &nbsp;&nbsp;Present&nbsp;'. $chkMsg .'</td></tr>' . "\n" : '<tr><td style="color: red;">  &nbsp;&nbsp;'. $table .'</td><td class="data-container" style="color: red; background-image: url(../includes/js/ThemeOffice/warning.png); background-position: 5px 0px; background-repeat: no-repeat; padding-left: 18px;"> &nbsp;Missing or Damaged</td></tr>';

                 }

				$dba = @mysql_select_db($mosConfig_db)
				  or die("Couldn't select the database.");

	            $sessionQuery ="SELECT * FROM ". $mosConfig_dbprefix ."session";
	            $sessionResult=mysql_query($sessionQuery);
	   		    $stale = time()-$mosConfig_lifetime;
			?>


			<tr><td height="20px;" colspan="2">&nbsp;</td></tr>
        <tr>
		  <td colspan="2"><h3>Mambo Session Status Dashboard</h3></td>
	    </tr>
			 <tr><td colspan="2">Session LifeTime: <?php echo $mosConfig_lifetime; ?> seconds</td></tr>
             <tr>
			   <th align="left">&nbsp;User Name</th>
			   <th align="left">&nbsp;User Type</th>
			 </tr>

			<?php
            	while ($row = mysql_fetch_array($sessionResult)) {

	                if ($row['time'] < $stale) {
	                  $isStaleHi = "blue";
					  $isStale   = "Stale";
    	            } else {
	                  $isStaleHi = "green";
					  $isStale   = "Valid";
					}
			?>
            <tr>
			  <td>&nbsp;&nbsp;<font color="<?php echo $isStaleHi; ?>"><?php echo $row['username']; ?></font></td>
			  <td>&nbsp;&nbsp;<?php echo $row['usertype']; ?>&nbsp;&nbsp;&nbsp;&nbsp;<font color="<?php echo $isStaleHi; ?>"><?php echo $isStale; ?></font></td>
			</tr>
			<?php } ?>
                </table>




	  </td>
      <!--// RIGHT COLUMN //-->
      <td width="170" valign="top" style="padding-right: 15px;" class="right-col">
	  <h3>Information</h3>
      <?php


	  ?>
	  </td>
    </tr>
</table>


<!--// END DATABASE TAB //-->
		<?php
		$tabs->endTab();
		$tabs->endPane();
		?>



		<?php
//	}

	function ListComponents() {
		global $database;

		$query = "SELECT params"
		. "\n FROM #__modules "
		. "\n WHERE module = 'mod_components'"
		;
		$database->setQuery( $query );
		$row = $database->loadResult();
		$params = new mosParameters( $row );

		mosLoadAdminModule( 'components', $params );
	}



//}



function writableCell( $folder, $relative=0, $text='' ) {
	$writeable 		= '<b><font color="green">Writeable</font></b>&nbsp;&nbsp;';
	$unwriteable 	= '<b><font color="red">Unwriteable</font></b>&nbsp;&nbsp;';

	echo '<tr>';
	echo '<td class="item">' . $folder . '/</td>';
	echo '<td align="right" style="border-right: 1px solid #c0c0c0;">';
	if ( $relative ) {
		echo is_writable( "../../$folder" ) 	? $writeable : $unwriteable;
	} else {
		echo is_writable( "../$folder" ) 		? $writeable : $unwriteable;
	}
	echo '</td>';
	echo '<td class="item" align="center">';
		if (substr(sprintf('%o', fileperms("../".$folder)), -1) == '7') 
			{ echo "<font color='red'>"; } 
	 		elseif (substr(sprintf('%o', fileperms("../".$folder)), -1) <= '4') 
				{ echo "<font color='blue'>"; }
				else { echo "<font color='green'>"; }

			if ( $relative ) {
		 		echo "". substr(sprintf('%o', fileperms("../../".$folder)), -4) ."";
			} else { 
				echo "". substr(sprintf('%o', fileperms("../".$folder)), -4) ."";
			}
		echo '</font>';
		echo '</td>';

	echo '</tr>';
	}
